<style type='text/css'>

input.wiki-action { color: #000000; background-color: #6aee28; font-family: Arial, Helvetica, sans-serif; font-size: 12px; border: 1px solid #000000; font-weight: bold;}

input.wiki-action:hover { color: #000000; background-color: #c2fc20; font-family: Arial, Helvetica, sans-serif; font-size: 12px; border: 1px solid #000000; font-weight: bold;}


.content xtable {
	border: 1px solid black;
	}
	
.sections { 
        margin-top: 16px;
	border: 1px solid black;
	background: #fef790;
	}
	
.sections th {
	background: #fde42d; 
	}
	
.sections .h1 {
	padding: 2px;
	padding-left: 0px;
	}
.sections .h2 {
	padding: 2px;
	padding-left: 16px;
	}
.sections .h3 {
	padding: 2px;
	padding-left: 32px;
	}
.sections .h4 {
	padding: 2px;
	padding-left: 48px;
	}
	
.sections .h5 {
	padding: 2px;
	padding-left: 64px;
	}
.sections .h6 {
	padding: 2px;
	padding-left: 72px;
	}
	
.term {
	background: #000000;
	color: #ffffff;
	font-weight: bold;
	}
        
.diff-addedline {
    background: #ddffdd;
    font-family: monospace;
    }
.diff-deletedline {
    background: #ffdddd;
    font-family: monospace;
    }
.diff-context {
    background: #ddddff;
    font-family: monospace;
    }

.diff-blockheader {
    xfont-weight: bold;
    font-style: italic;
    }
	
.wiki h1, .wiki h2, .wiki h3, .wiki h4, .wiki h5, .wiki h6 {
	border: 0px;
	padding: 0px;
	background: none;
	}
        
.wiki div.h1 {
    }
.wiki div.h2 {
    }
    
.wiki dt {
    font-style: italic;
    }
    
.wiki h3 {
    xmargin-left: 48px; 
    }
.wiki div.h3 {
    xmargin-left: 48px;
    }
        
.wiki code, .wiki pre.python, .wiki pre.php, .wiki pre.c, .wiki pre.html {
    background: #eeeeee;
    padding: 4px;
    border: 1px dashed #888888;
    }
    
.wiki pre {
    }
    
.wiki table {
    border-top: 1px solid #888888;
    border-left: 1px solid #888888;
    border-spacing: 0px; border-collapse: collapse;
    }
.wiki td {
    border-bottom: 1px solid #888888;
    border-right: 1px solid #888888;
    padding: 3px;
    }
.wiki th {
    background: #eeeeee;
    border-bottom: 1px solid #888888;
    border-right: 1px solid #888888;
    padding: 3px;
    }

.comments { 
	border: 1px solid black; 
	background: #fef790;
	padding: 4px;
	margin-top: 12px;
	margin-bottom: 12px;
	}
	
.comments th {
	background: #fde42d;
	}
	
.comments td {
	background: #fef790;
	}
	
.comments pre {
	font-size: 12px;
	margin: 0px;
	padding: 0px;
	}

</style>
<?
global $_skin;
$wiki = $_skin["wiki"];
$link = $wiki["link"];

$t1 = $wiki["title"];
$t2 = $_skin["title"];

$title = $t1;
if ($t2) { if ($t1) { $title.= " - "; } $title .= $t2; }

echo "<a name=\"_\"></a><h1>$title</h1>";

$link = $wiki["link"];

echo "<table cellpadding=0 cellspacing=0 border=0><tr>";
if ($link!="") {
	echo "<td>";
	echo "<form action='$link'>";
        echo "<input type='hidden' name='action' value='' id='link_action'>";
	#echo "<input type='hidden' name='link' value='$link'>";
	foreach (array("view","edit","meta","source","history","links") as $v) {
		echo "<input type='button' class='wiki-action' onclick='document.getElementById(\"link_action\").value=\"$v\";form.submit();' value='$v'>";
		echo "&nbsp;";
		}
	echo "</form>";
	}

echo "<td><form action='$topurl/wiki/search.php' method=get>Search:&nbsp;<input type='text' name='query' value=\"".htmlentities($_REQUEST["query"])."\" size=12>&nbsp;<input type='submit' value='Go' class='wiki-action'></form>";

echo "<td>&nbsp;";
echo "<td align=right><form action='$topurl/wiki/map.php' method=get><input type='submit' value='Wiki Map' class='wiki-action'></form>";

echo "<td>&nbsp;";
echo "<td align=right><form action='$topurl/wiki/recent.php' method=get><input type='submit' value='Recent Changes' class='wiki-action'></form>";

echo "</table>";

global $_wiki_sections;
$r = $_wiki_sections;
if (count($r) > 1) {
        #array_unshift($r,array("title"=>$title,"element"=>"h1"));
	echo "<table class='sections' align=right>";
	echo "<tr><th>sections</th>";
        $level = 6;
	foreach ($r as $e) if ($e["section"] != "_") {
            $l = substr($e["element"],1,1);
            $level = min($level,$l);
            }
	foreach ($r as $e) if ($e["section"] != "_") {
                $l = substr($e["element"],1,1) - $level + 1;
         	echo "<tr><td class='h$l'><a href='#{$e["section"]}'>{$e["title"]}</a>";
		}
	echo "</table>";
	}

#echo "<div class='wiki'>%%</div>";
echo "<div>%%</div>";
